Was download a simple but lengthy text file from text files that come to practice at this stage
to open a file in vim just type vim followed by a file name as an argument.
We are now in normal mode.
You should place your hand in the touch typing position that is your left index finger should be placed
on the F key and your right index finger on the J key.
We can use vim without ever needing to pick up the mouse.
You'll see why this is awesome.
As the chorus unfolds in normal mode we cannot insert text.
We primarily move around and copy and paste text among other things other than normal mode.
We have insertion mode and visual mode which will cover in a bit.
Let's learn to move around first.
Your right index finger is on the JKA by pressing J.
We jump down to the next line with k we go up one line with L.
You move one character to the right.
Use your ring finger with H.
You move one character to the left.
Stretch your right index finger to jump multiple lines at a time.
You can use page up and page down but that will not be convenient as you will have to move away from
the Homero position that is you will have to move your index fingers away from the position we've talked
about earlier.
You can use the control f and control B button combinations to jump irrespectively forward and backward
in the document.
To get to the bottom of the document you can press.
Capital G.
To get back to the top of the document you can tap lowercase g two times to go to a specific line number.
You can type the number of the line followed by a capital G like 100.
Capital G 1 0 0 capital G.
By the way most of these shortcuts will work in many other contexts.
In a Linux terminal like for example in the Linux manuals control A.F. control be kept LG Gigi Priscu
to exit then press up twice to get to our previous command then enter.
Here we are again.
You can press shift m to place the cursor on the medium height of the visible document portion shift
L to the lower one and shift H to the higher one you can respectively go to the start and the end of
a paragraph.
Way curly braces
and respectively to the start and end of a sentence with parenthesis.
Now let's cover line movement press Jiji to get back to the beginning of the document with the dollar
sign.
We've moved to the very end of a line
with zero.
We move back to the very beginning of the line let's go back to the end of the line again with the exponential
of words or character we get back to the first character of the line instead of the very beginning of
it.
It ignores whitespace and stops on the very first character of the line.
Press Douro Now there's another set of keys dedicated to the word per word movement which are very interesting
we can use doubloon to move to the first letter of every subsequent word
as you can see when lend them the first letter of each word but we also learned that in the period special
characters in general are evaluated to get to the previous word.
You tap the press it multiple times
to move to the next word while skipping punctuation or special characters you can hold shift while pressing
w.
Use the right hand pinky to hold right shift then press w.
The same goes for the big key to move to the previous word.
Keep a holding right shift and Presby.
You can also press g followed by the to lend with a cursor on the last character of the previous word.
It doesn't do it for me.
Too many key presses.
There will be a combination to jump one word backwards.
The key moves instead to the next word.
Placing the cursor on its last character.
You can also use shift together with the Skip special characters and it command in them can be repeated
a given number of times by typing a number on your keyboard before the command which is very cool.
For example let's say we wanted to jump 10 lines.
We use j to go to the line and below so we will press 1 then 0 then j.
Let's jump back nine lines brazed 9 then K by typing in number followed by the pipe character.
We move to the given column.
For example 40 followed by a pipe character will move us to column 40 on the line
before moving to the next.
The video will show you how to switch from normal mode to the other two ones to get into insertion mode.
There are various ways.
The first one I'm going to teach you is by simply pressing the key.
You can then type starting from the current position of the cursor to get back to normal mode.
Just press Escape insertion mode just lets you type in text visual mode instead lets you select text
graphically to edit it.
Press the V key to enter in visual mode.
Now we can use any of the movie keys.
I've talked about before to select checks go down with J.
Select other words with W or E..
Once the text is selected you can copy it to a register to the system clipboard delete it and so on.
Then press escape again to get back to normal mode
to exit with type colon.
Then we can write to the file that is saved the file by typing w save and quit by typing in WQ or exit
without saving by typing queue followed by an exclamation mark.
You can also save in quotes by double tapping.
Kept old Z on the keyboard.
Good now you know how to navigate documents in vim.
Goodbye mouse.
The movement keys are all too important because Wiliam put them as modifiers for actions like deleting
copying and pasting text.
This is what we'll cover in the next video.
Get comfortable with the keys with talked about in this video first.
Oh and if you ever make the mistake of pressing Kontrol s to save your document from will get stuck
in suspense.
The Editor.
It's a legacy function out the press control queue to unstuck it.
OK.
See you in the next video.